Word-wrap: Allows splitting of long, indivisible words and wrapping to the next line. (same effect in English and Chinese)Word-wrap has two values:1. Word-wrap:normal: line breaks only allowed hyphenation points (the browser keeps the default
Word-wrap: Allows splitting of long, indivisible words and wrapping to the next line. (same effect in English and Chinese)Word-wrap has two values:1. Word-wrap:normal: line breaks only allowed hyphenation points (the browser keeps the default
Forced line break 1, Word-break:break-all; Only works in English, with letters as the basis for line-wrapping. 2, Word-wrap:break-word; Only works in English, with words as the basis for line change. 3, White-space:pre-wrap; Only
In our daily coding, we often encounter this text can not be wrapped, or automatic line-wrapping requirements. Although this feature is common in our usual but I believe that we will not be able to remember it (at least, Xiao Yue is very lazy is
This digest from http://www.wufangbo.com/css-qiang-zhi-huan-hang/Properties used to force line breaks and force non-wrappingWe generally control the CSS properties used for line wrapping a total of three:Word-wrap; word-break; white-space. These
Force No Line breakDiv { white-space:nowrap;}Wrap LineDiv { word-wrap: break-word; word-break: normal; }Force English words to breakDiv { word-break:break-all;}CSS settings do not change careers:Overflow:hidden Hiddenwhite-space: normal defaultpre
What are these two things, I believe there are still a lot of people confused, will only be rote writing a word-wrap:break-word;word-break:break-all, such things to force the segmentation, or because these two things are too awkward, The same length,
Force No Line break
div{
White-space:nowrap;
}
Wrap Line
div{
Word-wrap:break-word;
Word-break:normal;
}
Force English words to break
div{
Word-break:break-all;
}
CSS settings do not change careers:
Overflow:hidden
1. Word-break:break-all; only works on English, with the letter as the line of change according to 2. Word-wrap:break-word; Only works in English, with the word as the line of change according to 3. White-space:pre-wrap; Only works on Chinese,
1. Word-break:break-all; only works on English, with the letter as the line of change according to 2. Word-wrap:break-word; Only works in English, with the word as the line of change according to 3. White-space:pre-wrap; Only works on Chinese,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.